<%@page import="cn.yunhe.entity.Topic"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="css/bootstrap.min.css" rel="stylesheet" >
<script type="text/javascript" src ="js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src ="js/bootstrap.min.js"></script>
<title>Insert title here</title>
<base target="_blank">
</head>
<body>
	<%--  <% Object obj=request.getAttribute("tlist"); %>
	<table  class="table">
		<tr>
			<td>标题</td>
			<td>作者</td>
			<td>发帖时间</td>
		</tr>
	
	<%
		if(obj!=null){
			List<Topic>tlist=(List<Topic>) obj;	
			for(int i=0;i<tlist.size();i++){
				Topic t=tlist.get(i);	
				if (i % 2 == 0) {
	%>
		<tr>
			<td><a href="getTopicDetail?tid=<%=t.getId()%>"><%=t.getTitle()%></a></td>
			<td><%=t.getUser().getLoginName()%></td>
			<td><%=t.getCreateTime()%></td>
		</tr>	
		<%
			} else {
		%>
		<tr class="info">
			<td><a href="getTopicDetail?tid=<%=t.getId()%>"><%=t.getTitle() %></a></td>
			<td><%=t.getUser().getLoginName()%></td>
			<td><%=t.getCreateTime()%></td>
		</tr>
		<%
			}
		%>

		<%
			}
			}
		%>
 --%>		
	 <table  class="table">
			<tr>
				<td style="font-size: 16px">标题</td>
				<td style="font-size: 16px">作者</td>
				<td style="font-size: 16px">时间</td>
				<td ><a class="btn btn-primary" href="ToAddTopic?bid=${bid}" target="showFrame">发帖</a></td>
			</tr>
			<c:forEach items="${tlist}" var="tlist" varStatus="forEachlist">
				<c:choose>
					<c:when test="${forEachlist.index %2 ==0}">
						<tr class="info">
							<td><a href="getTopicDetail?tid=${tlist.id}">${tlist.title}</a></td>
							<td>${tlist.user.loginName}</td>
							<td>${tlist.createTime}</td>
							<td></td>
						</tr>	
					</c:when>
					<c:otherwise >				
						<tr>
							<td><a href="getTopicDetail?tid=${tlist.id}">${tlist.title}</a></td>
							<td>${tlist.user.loginName}</td>
							<td>${tlist.createTime}</td>
							<td></td>
						</tr>	
					</c:otherwise>
				</c:choose>
			</c:forEach>
	</table> 
</body>
</html>